package funcs;

import org.apache.log4j.Logger;
import org.apache.log4j.Priority;

/**
 * 《日志》实现类
 * 
 * @author 黄海清
 * @version $Id: Logit.java,v 1.1 2010-07-10 12:42:44 haris Exp $
 */
public class Logit {

	static {
		String path = Thread.currentThread().getContextClassLoader()
				.getResource("conf/log4j.properties").getPath();
		org.apache.log4j.PropertyConfigurator.configure(path);
	}

	/**
	 * 系统日志
	 */
	protected static Logger SYSTEM_LOG = Logger.getLogger("sys");
	/**
	 * 操作日志
	 */
	protected static Logger OPT_LOG = Logger.getLogger("opt");

	/**
	 * 系统日志
	 * 
	 * @param priority
	 * @param msg
	 */
	public static void systemLog(Priority priority, String msg) {
		SYSTEM_LOG.log(priority, msg);
	}

	/**
	 * 短信日志
	 * 
	 * @param log
	 */
	public static void optLog(String log) {
		OPT_LOG.info(log);
	}
}
